home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cfengine-1.5.3 / src / classes.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-20  |  15.7 KB  |  516 lines

  1. /* cfengine for GNU
  2.  
  3.         Copyright (C) 1995
  4.         Free Software Foundation, Inc.
  5.  
  6.    This file is part of GNU cfengine - written and maintained 
  7.    by Mark Burgess, Dept of Computing and Engineering, Oslo College,
  8.    Dept. of Theoretical physics, University of Oslo
  9.  
  10.    This program is free software; you can redistribute it and/or modify it
  11.    under the terms of the GNU General Public License as published by the
  12.    Free Software Foundation; either version 2, or (at your option) any
  13.    later version.
  14.  
  15.    This program is distributed in the hope that it will be useful,
  16.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.    GNU General Public License for more details.
  19.  
  20.   You should have received a copy of the GNU General Public License
  21.   along with this program; if not, write to the Free Software
  22.   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  23.  
  24. */
  25.  
  26.  
  27.  
  28. /*******************************************************************/
  29. /*                                                                 */
  30. /*  GLOBAL class default variables for cfengine                    */
  31. /*  These variables are what needs to be modified if you add or    */
  32. /*  modify class definitions... remember also to change clsattr    */
  33. /*  and search for the os types in cfengine.c (mount stuff)        */
  34. /*                                                                 */
  35. /*******************************************************************/
  36.  
  37. #include "cf.defs.h"
  38.  
  39. /*********************************************************************/
  40.  
  41.                       /* See also "enum classes" in cf.defs.h        */
  42. char *CLASSTEXT[] =   /* If you change here change enum classes too! */
  43.    {
  44.    "",
  45.    "<soft>",
  46.    "sun4",
  47.    "ultrix",
  48.    "hpux10",
  49.    "hpux",
  50.    "aix",
  51.    "linux",
  52.    "solaris",
  53.    "osf",
  54.    "digital",
  55.    "sun3",
  56.    "irix4",
  57.    "irix",
  58.    "irix64",
  59.    "freebsd",
  60.    "solarisx86",
  61.    "bsd4_3",
  62.    "newsos",
  63.    "netbsd",
  64.    "aos",
  65.    "bsdos",
  66.    "nextstep",
  67.    "cray",
  68.    "gnu",
  69.    "nt",
  70.    "unix_sv",
  71.    "openbsd",
  72.    "sco",
  73.    "unused1",
  74.    "unused2",
  75.    "unused3",
  76.    NULL
  77.    };
  78.  
  79. /*********************************************************************/
  80.  
  81.   /* remember to change cf.defs.h !!  */
  82.  
  83. char *CLASSATTRIBUTES[clssattr][attrdim] =
  84.    {                            /* Only as many characters */
  85.    "-","-","-",                 /* as appear here are matched. The     */
  86.    "-","-","-",                 /* fields are sysname and machine */
  87.    "sunos","*","4*",           /* sun 4  */
  88.    "ultrix","risc","4*",       /* ultrix */
  89.    "hp-ux","9000*","?.1?.*",   /* hpux10 */
  90.    "hp-ux","9000*","*",        /* hpux */
  91.    "aix","*","*",              /* aix */
  92.    "linux","*","*",            /* linux */
  93.    "sunos","sun4?","5*",       /* solaris */
  94.    "osf1","alpha","*",         /* osf1 */
  95.    "osf1","alpha","4*",        /* digital */   
  96.    "sunos","sun3","4*",        /* sun3 */
  97.    "irix4","ip*","4*",         /* irix4 */
  98.    "irix", "ip*","*",          /* irix */
  99.    "irix64","ip*","*",         /* irix64 */
  100.    "freebsd","i?86","*",       /* freebsd */
  101.    "sunos","i86pc","5*",       /* solarisx86 */
  102.    "bsd","*","*",              /* bsd 4.3 */
  103.    "newsos","*","*",           /* newsos4 */
  104.    "netbsd","*","*",           /* NetBSD */
  105.    "aos","*","*",              /* AOS */
  106.    "bsd/os","*","*",           /* BSDI */
  107.    "nextstep","*","*",         /* nextstep */
  108.    "sn*","cray*","*",          /* cray */
  109.    "gnu*","*","*",             /* gnu */
  110.    "cygwin_nt*","*","*",       /* NT */
  111.    "unix_sv","*","*",          /* Unixware */
  112.    "openbsd","*","*",          /* OpenBSD */
  113.    "sco_sv","*","*",           /* SCO */
  114.    "unused1","blah","blah",
  115.    "unused2","blah","blah",
  116.    "unused3","blah","blah",
  117.    NULL,NULL,NULL
  118.    };
  119.  
  120. /*********************************************************************/
  121.  
  122. char *VPSCOMM[clssattr] =
  123.    {
  124.    "",
  125.    "",
  126.    "/bin/ps",       /* sun 4  */
  127.    "/bin/ps",       /* ultrix */
  128.    "/bin/ps",       /* hpux10 */
  129.    "/bin/ps",       /* hpux */
  130.    "/bin/ps",       /* aix */
  131.    "/bin/ps",       /* linux */
  132.    "/bin/ps",       /* solaris */
  133.    "/bin/ps",       /* osf1 */
  134.    "/bin/ps",       /* digital */   
  135.    "/bin/ps",       /* sun3 */
  136.    "/bin/ps",       /* irix4 */
  137.    "/bin/ps",       /* irix */
  138.    "/bin/ps",       /* irix64 */
  139.    "/bin/ps",       /* freebsd */
  140.    "/bin/ps",       /* solarisx86 */
  141.    "/bin/ps",       /* bsd 4.3 */
  142.    "/bin/ps",       /* newos4 */
  143.    "/bin/ps",       /* netbsd */
  144.    "/bin/ps",       /* AOS */
  145.    "/bin/ps",       /* BSDI */
  146.    "/bin/ps",       /* nextstep */
  147.    "/bin/ps",       /* cray */
  148.    "/bin/ps",       /* gnu */
  149.    "/bin/ps",       /* NT - cygnus */
  150.    "/bin/ps",       /* unixware */
  151.    "/bin/ps",       /* openbsd */
  152.    "/bin/ps",       /* sco */
  153.    "/bin/ps",
  154.    "/bin/ps",
  155.    "/bin/ps",
  156.    NULL
  157.    };
  158.  
  159. /*********************************************************************/
  160.  
  161. char *VPSOPTS[clssattr] =
  162.    {
  163.    "",
  164.    "",
  165.    "-ax",    /* sun4 */
  166.    "-ax",    /* ultrix */
  167.    "-ef",    /* hp10 */
  168.    "-ef",    /* hpux */
  169.    "-ef",    /* aix */
  170.    "-ax",    /* linux */
  171.    "-ef",    /* solaris */
  172.    "-ef",    /* osf1 */
  173.    "-ax",    /* digital */   
  174.    "-ax",    /* sun3 */
  175.    "-ef",    /* irix4 */
  176.    "-ef",    /* irix */
  177.    "-ef",    /* irix64 */
  178.    "-ax",    /* freebsd */
  179.    "-ef",    /* solarisx86 */
  180.    "-ax",    /* bsd 4.3 */
  181.    "-ax",    /* newsos4 */
  182.    "-ax",    /* netbsd */
  183.    "-ax",    /* AOS */
  184.    "-ax",    /* BSDI */
  185.    "-ax",    /* nextstep */
  186.    "-ef",    /* cray */
  187.    "-ax",    /* gnu */
  188.    "-a",     /* NT */
  189.    "-ef",    /* Unixware */
  190.    "-ax",    /* openbsd */
  191.    "-ef",    /* sco */
  192.    "-",
  193.    "-",
  194.    "-",
  195.    NULL
  196.    };
  197.  
  198. /*********************************************************************/
  199.  
  200. char *VMOUNTCOMM[clssattr] =
  201.    {
  202.    "",                                              /* see cf.defs.h */
  203.    "",
  204.    "/etc/mount -va",      /* sun4 */
  205.    "/etc/mount -va",      /* ultrix */
  206.    "/sbin/mount -ea",      /* hpux10 */
  207.    "/etc/mount -va",      /* hpux */
  208.    "/etc/mount -t nfs",   /* aix */
  209.    "/bin/mount -va",      /* linux */
  210.    "/usr/sbin/mount -a",  /* solaris */
  211.    "/usr/sbin/mount -va", /* osf1 */
  212.    "/usr/sbin/mount -va", /* digital */   
  213.    "/etc/mount -va",      /* sun3 */
  214.    "/sbin/mount -va",     /* irix4 */
  215.    "/sbin/mount -va",     /* irix */
  216.    "/sbin/mount -va",     /* irix64 */
  217.    "/sbin/mount -va",     /* freebsd */
  218.    "/usr/sbin/mount -a",  /* solarisx86 */
  219.    "/etc/mount -a",       /* bsd 4.3 */
  220.    "/etc/mount -a",       /* newsos4 */
  221.    "/sbin/mount -a",      /* netbsd */
  222.    "/etc/mount -a",       /* AOS */
  223.    "/sbin/mount -a",      /* BSDI */
  224.    "/usr/etc/mount -a",   /* nextstep */
  225.    "/etc/mount -va",      /* cray */
  226.    "/bin/mount -va",      /* gnu */
  227.    "/bin/sh /etc/fstab",  /* NT - possible security issue */
  228.    "/sbin/mountall",      /* Unixware */
  229.    "/sbin/mount",         /* openbsd */
  230.    "/etc/mountall",         /* sco */
  231.    "unused-blah",
  232.    "unused-blah",
  233.    "unused-blah",
  234.    NULL
  235.    };
  236.  
  237. /*********************************************************************/
  238.  
  239. char *VUNMOUNTCOMM[clssattr] =
  240.    {
  241.    "",                                              /* see cf.defs.h */
  242.    "",
  243.    "/etc/umount",      /* sun4 */
  244.    "/etc/umount",      /* ultrix */
  245.    "/sbin/umount",     /* hpux10 */
  246.    "/etc/umount",      /* hpux */
  247.    "/etc/umount",      /* aix */
  248.    "/bin/umount",      /* linux */
  249.    "/etc/umount",      /* solaris */
  250.    "/usr/sbin/umount", /* osf1 */
  251.    "/usr/sbin/umount", /* digital */   
  252.    "/etc/umount",      /* sun3 */
  253.    "/sbin/umount",     /* irix4 */
  254.    "/sbin/umount",     /* irix */
  255.    "/sbin/umount",     /* irix64 */
  256.    "/sbin/umount",     /* freebsd */
  257.    "/etc/umount",      /* solarisx86 */
  258.    "/etc/umount",      /* bsd4.3 */
  259.    "/etc/umount",      /* newsos4 */
  260.    "/sbin/umount",     /* netbsd */
  261.    "/etc/umount",      /* AOS */
  262.    "/sbin/umount",     /* BSDI */
  263.    "/usr/etc/umount",  /* nextstep */
  264.    "/etc/umount",      /* cray */
  265.    "/sbin/umount",     /* gnu */
  266.    "/bin/umount",      /* NT */
  267.    "/sbin/umount",     /* Unixware */
  268.    "/sbin/umount",     /* openbsd */
  269.    "/etc/umount",     /* sco */
  270.    "unused-blah",
  271.    "unused-blah",
  272.    "unused-blah",
  273.    NULL
  274.    };
  275.  
  276.  
  277.  
  278. /*********************************************************************/
  279.  
  280. char *VMOUNTOPTS[clssattr] =
  281.    {
  282.    "",                                              /* see cf.defs.h */
  283.    "",
  284.    "bg,hard,intr",    /* sun4 */
  285.    "bg,hard,intr",    /* ultrix */
  286.    "bg,hard,intr",    /* hpux10 */
  287.    "bg,hard,intr",    /* hpux */
  288.    "bg,hard,intr",    /* aix */
  289.    "defaults",        /* linux */
  290.    "bg,hard,intr",    /* solaris */
  291.    "bg,hard,intr",    /* osf1 */
  292.    "bg,hard,intr",    /* digital */   
  293.    "bg,hard,intr",    /* sun3 */
  294.    "bg,hard,intr",    /* irix4 */
  295.    "bg,hard,intr",    /* irix */
  296.    "bg,hard,intr",    /* irix64 */
  297.    "bg,intr",         /* freebsd */
  298.    "bg,hard,intr",    /* solarisx86 */
  299.    "bg,hard,intr",    /* bsd4.3 */
  300.    "bg,hard,intr",    /* newsos4 */
  301.    "-i,-b",           /* netbsd */
  302.    "bg,hard,intr",    /* AOS */
  303.    "bg,intr",         /* BSDI */
  304.    "bg,hard,intr",    /* nextstep */
  305.    "bg,hard,intr",    /* cray */
  306.    "defaults",        /* gnu */
  307.    "",                /* NT */
  308.    "bg,hard,intr",    /* Unixware */
  309.    "-i,-b",           /* openbsd */
  310.    "bg,hard,intr",    /* sco */
  311.    "unused-blah",
  312.    "unused-blah",
  313.    "unused-blah",
  314.    NULL
  315.    };
  316.  
  317. /*********************************************************************/
  318.  
  319. char *VIFDEV[clssattr] =
  320.    {
  321.    "-",
  322.    "-",                                              /* see cf.defs.h */
  323.    "le0",    /* sun4 */
  324.    "ln0",    /* ultrix */
  325.    "lan0",   /* hpux10 */
  326.    "lan0",   /* hpux */
  327.    "en0",    /* aix */
  328.    "eth0",   /* linux */ 
  329.    "le0",    /* solaris */
  330.    "ln0",    /* osf1 */
  331.    "ln0",    /* digital */   
  332.    "le0",    /* sun3 */
  333.    "ec0",    /* irix4 */
  334.    "ec0",    /* irix */
  335.    "ec0",    /* irix64 */
  336.    "ep0",    /* freebsd */
  337.    "dnet0",  /* solarisx86 */
  338.    "le0",    /* bsd4.3 */
  339.    "en0",    /* newsos4 */
  340.    "le0",    /* netbsd */
  341.    "un0",    /* AOS */
  342.    "le0",    /* BSDI */
  343.    "en0",    /* nextstep -default */
  344.    "en0",    /* cray */
  345.    "eth0",   /* gnu */
  346.    "N/A",    /* NT */
  347.    "unknown", /* Unixware */
  348.    "le0",    /* openbsd */
  349.    "net0",   /* sco */
  350.    "unused-blah",
  351.    "unused-blah",
  352.    "unused-blah",
  353.    NULL
  354.    };
  355.  
  356.  
  357. /*********************************************************************/
  358.  
  359. char *VRESOLVCONF[clssattr] =
  360.    {
  361.    "-",
  362.    "-",                                              /* see cf.defs.h */
  363.    "/etc/resolv.conf",     /* sun4 */
  364.    "/etc/resolv.conf",     /* ultrix */
  365.    "/etc/resolv.conf",     /* hpux10 */
  366.    "/etc/resolv.conf",     /* hpux */
  367.    "/etc/resolv.conf",     /* aix */
  368.    "/etc/resolv.conf",     /* linux */   
  369.    "/etc/resolv.conf",     /* solaris */
  370.    "/etc/resolv.conf",     /* osf1 */
  371.    "/etc/resolv.conf",     /* digital */   
  372.    "/etc/resolv.conf",     /* sun3 */
  373.    "/usr/etc/resolv.conf", /* irix4 */
  374.    "/etc/resolv.conf",     /* irix */
  375.    "/etc/resolv.conf",     /* irix64 */
  376.    "/etc/resolv.conf",     /* freebsd */
  377.    "/etc/resolv.conf",     /* solarisx86 */
  378.    "/etc/resolv.conf",     /* bsd4.3 */
  379.    "/etc/resolv.conf",     /* newsos4 */
  380.    "/etc/resolv.conf",     /* netbsd */
  381.    "/etc/resolv.conf",     /* AOS */
  382.    "/etc/resolv.conf",     /* BSDI */
  383.    "/etc/resolv.conf",     /* nextstep */
  384.    "/etc/resolv.conf",     /* cray */
  385.    "/etc/resolv.conf",     /* gnu */
  386.    "/etc/resolv.conf",     /* NT */
  387.    "/etc/resolv.conf",     /* Unixware */
  388.    "/etc/resolv.conf",     /* openbsd */
  389.    "/etc/resolv.conf",     /* sco */
  390.    "unused-blah",
  391.    "unused-blah",
  392.    "unused-blah",
  393.    NULL
  394.    };
  395.  
  396.  
  397.  
  398. /*********************************************************************/
  399.  
  400. char *VFSTAB[clssattr] =
  401.    {
  402.    "-",
  403.    "-",                                              /* see cf.defs.h */
  404.    "/etc/fstab",       /* sun4 */
  405.    "/etc/fstab",       /* ultrix */
  406.    "/etc/fstab",       /* hpux10 */
  407.    "/etc/checklist",   /* hpux */
  408.    "/etc/filesystems", /* aix */
  409.    "/etc/fstab",       /* linux */
  410.    "/etc/vfstab",      /* solaris */
  411.    "/etc/fstab",       /* osf1 */
  412.    "/etc/fstab",       /* digital */   
  413.    "/etc/fstab",       /* sun3 */
  414.    "/etc/fstab",       /* irix4 */
  415.    "/etc/fstab",       /* irix */
  416.    "/etc/fstab",       /* irix64 */
  417.    "/etc/fstab",       /* freebsd */
  418.    "/etc/vfstab",      /* solarisx86 */
  419.    "/etc/fstab",       /* bsd4.3 */
  420.    "/etc/fstab",       /* newsos4 */
  421.    "/etc/fstab",       /* netbsd */
  422.    "/etc/fstab",       /* AOS */
  423.    "/etc/fstab",       /* BSDI */
  424.    "/etc/fstab",       /* nextstep */
  425.    "/etc/fstab",       /* cray */
  426.    "/etc/fstab",       /* gnu */
  427.    "/etc/fstab",       /* NT */
  428.    "/etc/vfstab",      /* Unixware */
  429.    "/etc/fstab",       /* openbsd */
  430.    "/etc/default/filesys", /* sco */
  431.    "unused-blah",
  432.    "unused-blah",
  433.    "unused-blah",
  434.    NULL
  435.    };
  436.  
  437. /*********************************************************************/
  438.  
  439. char *VMAILDIR[clssattr] =
  440.    {
  441.    "-",
  442.    "-",                                              /* see cf.defs.h */
  443.    "/var/spool/mail",    /* sun4 */
  444.    "/usr/spool/mail",    /* ultrix */
  445.    "/var/mail",          /* hpux10 */
  446.    "/usr/mail",          /* hpux */
  447.    "/var/spool/mail",    /* aix */
  448.    "/var/spool/mail",    /* linux */  
  449.    "/var/mail",          /* solaris */
  450.    "/usr/spool/mail",    /* osf1 */
  451.    "/usr/spool/mail",    /* digital */   
  452.    "/var/spool/mail",    /* sun3 */
  453.    "/usr/mail",          /* irix4 */
  454.    "/usr/mail",          /* irix */
  455.    "/usr/var/mail",      /* irix64 */
  456.    "/var/mail",          /* freebsd */
  457.    "/var/mail",          /* solarisx86 */
  458.    "/usr/spool/mail",    /* bsd4.3 */
  459.    "/usr/spool/mail",    /* newsos4 */
  460.    "/var/mail",          /* netbsd */
  461.    "/usr/spool/mail",    /* AOS */
  462.    "/var/mail",          /* BSDI */
  463.    "/usr/spool/mail",    /* nextstep */
  464.    "/usr/mail",          /* cray */
  465.    "/var/spool/mail",    /* gnu */
  466.    "N/A",                /* NT */
  467.    "/var/mail",          /* Unixware */
  468.    "/var/mail",          /* openbsd */
  469.    "/var/spool/mail",    /* sco */
  470.    "unused-blah",
  471.    "unused-blah",
  472.    "unused-blah",
  473.    NULL
  474.    };
  475.  
  476. /*********************************************************************/
  477.  
  478. char *VNETSTAT[clssattr] =
  479.    {
  480.    "-",
  481.    "-", 
  482.    "/usr/ucb/netstat -rn",   /* sun4 */
  483.    "/usr/ucb/netstat -rn",   /* ultrix */
  484.    "/usr/bin/netstat -rn",   /* hpux10 */
  485.    "/usr/bin/netstat -rn",   /* hpux */
  486.    "/usr/bin/netstat -rn",   /* aix */
  487.    "/bin/netstat -rn",       /* linux */
  488.    "/usr/ucb/netstat -rn",   /* solaris */
  489.    "/usr/sbin/netstat -rn",  /* osf1 */
  490.    "/usr/sbin/netstat -rn",  /* digital */   
  491.    "/usr/ucb/netstat -rn",   /* sun3 */
  492.    "/usr/etc/netstat -rn",   /* irix4 */
  493.    "/usr/etc/netstat -rn",   /* irix */
  494.    "/usr/etc/netstat -rn",   /* irix64 */
  495.    "/usr/bin/netstat -rn",   /* freebsd */
  496.    "/bin/netstat -rn",       /* solarisx86 */
  497.    "/usr/ucb/netstat -rn",   /* bsd4.3 */
  498.    "/usr/ucb/netstat -rn",   /* newsos4 */
  499.    "/usr/bin/netstat -rn",   /* netbsd */
  500.    "/usr/ucb/netstat -rn",   /* AOS */
  501.    "/usr/sbin/netstat -rn",  /* BSDI */
  502.    "/usr/ucb/netstat -rn",   /* nextstep */
  503.    "/usr/ucb/netstat -rn",   /* cray */
  504.    "/bin/netstat -rn",       /* gnu */
  505.    "/C/WINNT/System32/netstat", /* NT */
  506.    "/usr/bin/netstat -rn",   /* Unixware */
  507.    "/usr/bin/netstat -rn",   /* openbsd */
  508.    "/usr/bin/netstat -rn",   /* sco */
  509.    "unused-blah",
  510.    "unused-blah",
  511.    "unused-blah",
  512.    NULL
  513.    };
  514.  
  515.  
  516.